Ext.define('TS.view.dilema.Grid' , {
	extend: 'TS.lib.Grid',
	alias : 'widget.dilemagrid',
	tbar:Factory.toolbar.search(),
	frame:false,
	store: 'Dilema',
	listeners:{
		'itemdblclick':function(){
			var id = Util.sel('dilema').internalId;
			Util.s.load('DilemaPointYes',where(
				['dilema_id',id],['dilema_point_side','1']
			));
			Util.s.load('DilemaPointNo',where(
				['dilema_id',id],['dilema_point_side','0']
			));
			Util.s.load('DilemaTag',where('dilema_id',id));
			return true;
		}
	},
	columns: [
	 	{xtype: 'rownumberer'},{
			header:'ID',
			hidden:true,
			dataIndex:'dilema_id'
		},{
			header:'Pytanie',
			sortable:true,
			dataIndex:'dilema_subject',
			renderer:function(v,index,rec){
				var tpl ='<div style="padding:10px;white-space:normal;font-size:17px;color:green;font-weight:bold;">{0}</div><div style="padding:10px;white-space:normal;line-height:10px;font-size:9px;color:gray;">{1}</div>';
				return Ext.String.format(tpl,v,rec.data.dilema_elaboration);
			}
		},{
			header:'Rozwinięcie pytania',
			hidden:true,
			dataIndex:'dilema_elaboration'
		}
	]
});